<?php
class User extends AppModel {
	var $name = 'User';
	var $primaryKey = 'user_id';

	function getUserList() {
		$users = $this->query("SELECT user_id, lastName, firstName FROM users");
		$userList = array();
		foreach($users as $user) {
			$userId = $user['users']['user_id'];
			$firstName = $user['users']['firstName'];
			$lastName = $user['users']['lastName'];
			$userList[$userId] = "$lastName, $firstName";
		}
		return $userList;
	}

	function checkUser($firstName, $lastName, $password) {
		$conditions = array('firstName' => $firstName, 
									'lastName' => $lastName,
									'password' => $password);
		$user = $this->find($conditions);
		return $user;
	}
}
?>
